/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.prepay.entity;

import com.jeesite.modules.base.entity.fixedexpense.FixedExpense;
import com.jeesite.modules.base.entity.taccount.Taccount;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 预付款Entity
 * @author wsm
 * @version 2021-03-18
 */
@Table(name="t_prepayment_actual", alias="a", columns={
		@Column(name="prepayment_actual_id", attrName="prepaymentActualId", label="实际预付款明细ID", isPK=true),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="row_number", attrName="rowNumber", label="车架号"),
		@Column(name="payment_method", attrName="paymentMethod", label="付款方式"),
		@Column(name="payment_bank", attrName="paymentBank", label="付款银行"),
		@Column(name="actual_prepayment_amount", attrName="actualPrepaymentAmount", label="实际预付款金额"),
		@Column(name="date", attrName="date", label="付款日期"),
		@Column(name="car_name", attrName="carName", label="车辆名称"),
		@Column(name="prepayment_type", attrName="prepaymentType", label="预付款类型"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="prepayment_id", attrName="prepaymentId.prepaymentId", label="预付款ID"),
	},joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= FixedExpense.class, attrName="fixedExpense", alias="b",
				on="b.fixed_expense_id = a.prepayment_type", columns={
				@Column(name="fixed_expense_id", label="类型id", isPK=true),
				@Column(name="fixed_expense_name", label="类型名称"),
		}),
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Taccount.class, attrName="taccount", alias="c",
				on="c.account_id = a.payment_bank", columns={
				@Column(name="account_id", label="银行id", isPK=true),
				@Column(name="account_name", label="银行名称"),
		})
}, orderBy="a.create_date ASC"
)
public class TprepaymentActual extends DataEntity<TprepaymentActual> {
	
	private static final long serialVersionUID = 1L;
	private String prepaymentActualId;		// 实际预付款明细ID
	private String frameNumber;		// 车架号
	private String carName;		// 车辆名称
	private String paymentMethod;		// 付款方式
	private String paymentBank;		// 付款银行
	private Double actualPrepaymentAmount;		// 实际预付款金额
	private Date date;		// 付款日期
	private Tprepayment prepaymentId;		// 预付款ID 父类
	private String prepaymentType;//预付款类型
	private String prepaymentTypeName;
	private Long rowNumber;
	private FixedExpense fixedExpense;
	private String paymentBankName;
	private Taccount taccount;

	public Taccount getTaccount() {
		return taccount;
	}

	public void setTaccount(Taccount taccount) {
		this.taccount = taccount;
	}

	public String getPaymentBankName() {
		return paymentBankName;
	}

	public void setPaymentBankName(String paymentBankName) {
		this.paymentBankName = paymentBankName;
	}

	public FixedExpense getFixedExpense() {
		return fixedExpense;
	}

	public void setFixedExpense(FixedExpense fixedExpense) {
		this.fixedExpense = fixedExpense;
	}

	public TprepaymentActual() {
		this(null);
	}

	public Long getRowNumber() {
		return rowNumber;
	}

	public void setRowNumber(Long rowNumber) {
		this.rowNumber = rowNumber;
	}

	public String getPrepaymentTypeName() {
		return prepaymentTypeName;
	}

	public void setPrepaymentTypeName(String prepaymentTypeName) {
		this.prepaymentTypeName = prepaymentTypeName;
	}

	public String getCarName() {
		return carName;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}

	public String getPrepaymentType() {
		return prepaymentType;
	}

	public void setPrepaymentType(String prepaymentType) {
		this.prepaymentType = prepaymentType;
	}

	public TprepaymentActual(Tprepayment prepaymentId){
		this.prepaymentId = prepaymentId;
	}
	
	public String getPrepaymentActualId() {
		return prepaymentActualId;
	}

	public void setPrepaymentActualId(String prepaymentActualId) {
		this.prepaymentActualId = prepaymentActualId;
	}
	
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	@Length(min=0, max=2, message="付款方式长度不能超过 2 个字符")
	public String getPaymentMethod() {
		return paymentMethod;
	}

	public void setPaymentMethod(String paymentMethod) {
		this.paymentMethod = paymentMethod;
	}
	
	@Length(min=0, max=50, message="付款银行长度不能超过 50 个字符")
	public String getPaymentBank() {
		return paymentBank;
	}

	public void setPaymentBank(String paymentBank) {
		this.paymentBank = paymentBank;
	}
	
	public Double getActualPrepaymentAmount() {
		return actualPrepaymentAmount;
	}

	public void setActualPrepaymentAmount(Double actualPrepaymentAmount) {
		this.actualPrepaymentAmount = actualPrepaymentAmount;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	
	@Length(min=0, max=64, message="预付款ID长度不能超过 64 个字符")
	public Tprepayment getPrepaymentId() {
		return prepaymentId;
	}

	public void setPrepaymentId(Tprepayment prepaymentId) {
		this.prepaymentId = prepaymentId;
	}
	
	public Date getDate_gte() {
		return sqlMap.getWhere().getValue("date", QueryType.GTE);
	}

	public void setDate_gte(Date date) {
		sqlMap.getWhere().and("date", QueryType.GTE, date);
	}
	
	public Date getDate_lte() {
		return sqlMap.getWhere().getValue("date", QueryType.LTE);
	}

	public void setDate_lte(Date date) {
		sqlMap.getWhere().and("date", QueryType.LTE, date);
	}
	
}